package it.yuzuojian.com.service.impl;

import com.sun.xml.internal.ws.api.FeatureListValidatorAnnotation;
import it.yuzuojian.com.dao.SongListMapper;
import it.yuzuojian.com.domain.SongList;
import it.yuzuojian.com.service.SongListService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class SongListServiceImpl implements SongListService {

    @Autowired
    private SongListMapper songListMapper;

    @Override
    public Boolean insert(SongList songList) {
        return songListMapper.insert(songList)>0;
    }

    @Override
    public Boolean update(SongList songList) {
        return songListMapper.update(songList)>0;
    }

    @Override
    public Boolean delete(Integer[] ids) {
        Boolean flag=true;
        for (Integer id : ids) {
            System.out.println(id);
            flag=songListMapper.delete(id)>0;
        }
        return flag;
    }

    @Override
    public SongList selectById(Integer id) {
        return songListMapper.selectById(id);
    }

    @Override
    public List<SongList> selectAll() {
        return songListMapper.selectAll();
    }

    @Override
    public List<SongList> selectByTitle(String title) {
        return songListMapper.selectByTitle(title);
    }

    @Override
    public List<SongList> selectByLikeTitle(String title) {
        return songListMapper.selectByLikeTitle(title);
    }

    @Override
    public List<SongList> selectByStyle(String style) {
        return selectByStyle(style);
    }

    @Override
    public List<SongList> selectByLikeStyle(String style) {
        return selectByLikeStyle(style);
    }
}
